/*
   POSPrinterControl.h
   
   Copyright (C) 2006 LinuxOne, Inc. <Republic of korea>

   This library is free software; you can redistribute it and/or modify
   it under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1
   of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   Lessor General Public License for more details.

   You should have received a copy of the GNU Lessor General Public
   License along with this library; if not, write to the Free Software
   Foundation, inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

   Hyunjin Kim <mgc521@linuxone.co.kr>

   LinuxOne, Inc., hereby disclaims all copylight
   written by Hyunjin Kim, 28 December 2006
*/

#ifndef _BOOYO_POS_POSPRINTER_CONTROL_H_
#define _BOOYO_POS_POSPRINTER_CONTROL_H_

#include <BaseControl.h>
#include <BooyoPOSException.h>
#include <const/POSPrinterConst.h>
#include <services/POSPrinterService.h>

namespace booyopos
{

class CPOSPrinter : public CBaseControl, public CPOSPrinterConst
{
private:
	services::CPOSPrinterService *pps;
public:
	CPOSPrinter();
	~CPOSPrinter();

	/* Capabilities */
	int GetCapCharacterSet() throw (CByException);
	bool GetCapConcurrentJrnRec() throw (CByException);
	bool GetCapConcurrentJrnSlp() throw (CByException);
	bool GetCapConcurrentRecSlp() throw (CByException);
	bool GetCapCoverSensor() throw (CByException);
	bool GetCapJrn2Color() throw (CByException);
	bool GetCapJrnBold() throw (CByException);
	bool GetCapJrnDhigh() throw (CByException);
	bool GetCapJrnDwide() throw (CByException);
	bool GetCapJrnDwideDhigh() throw (CByException);
	bool GetCapJrnEmptySensor() throw (CByException);
	bool GetCapJrnItalic() throw (CByException);
	bool GetCapJrnNearEndSensor() throw (CByException);
	bool GetCapJrnPresent() throw (CByException);
	bool GetCapJrnUnderline() throw (CByException);
	bool GetCapRec2Color() throw (CByException);
	bool GetCapRecBarCode() throw (CByException);
	bool GetCapRecBitmap() throw (CByException);
	bool GetCapRecBold() throw (CByException);
	bool GetCapRecDhigh() throw (CByException);
	bool GetCapRecDwide() throw (CByException);
	bool GetCapRecDwideDhigh() throw (CByException);
	bool GetCapRecEmptySensor() throw (CByException);
	bool GetCapRecItalic() throw (CByException);
	bool GetCapRecLeft90() throw (CByException);
	bool GetCapRecNearEndSensor() throw (CByException);
	bool GetCapRecPapercut() throw (CByException);
	bool GetCapRecPresent() throw (CByException);
	bool GetCapRecRight90() throw (CByException);
	bool GetCapRecRotate180() throw (CByException);
	bool GetCapRecStamp() throw (CByException);
	bool GetCapRecUnderline() throw (CByException);
	bool GetCapSlp2Color() throw (CByException);
	bool GetCapSlpBarCode() throw (CByException);
	bool GetCapSlpBitmap() throw (CByException);
	bool GetCapSlpBold() throw (CByException);
	bool GetCapSlpDhigh() throw (CByException);
	bool GetCapSlpDwide() throw (CByException);
	bool GetCapSlpDwideDhigh() throw (CByException);
	bool GetCapSlpEmptySensor() throw (CByException);
	bool GetCapSlpFullslip() throw (CByException);
	bool GetCapSlpItalic() throw (CByException);
	bool GetCapSlpLeft90() throw (CByException);
	bool GetCapSlpNearEndSensor() throw (CByException);
	bool GetCapSlpPresent() throw (CByException);
	bool GetCapSlpRight90() throw (CByException);
	bool GetCapSlpRotate180() throw (CByException);
	bool GetCapSlpUnderline() throw (CByException);
	bool GetCapTransaction() throw (CByException);
	int GetCapPowerReporting() throw (CByException);
	int GetCapJrnCartridgeSensor() throw (CByException);
	int GetCapJrnColor() throw (CByException);
	int GetCapRecCartridgeSensor() throw (CByException);
	int GetCapRecColor() throw (CByException);
	int GetCapRecMarkFeed() throw (CByException);
	bool GetCapSlpBothSidesPrint() throw (CByException);
	int GetCapSlpCartridgeSensor() throw (CByException);
	int GetCapSlpColor() throw (CByException);
	bool GetCapMapCharacterSet() throw (CByException);
	bool GetCapStatisticsReporting() throw (CByException);
	bool GetCapUpdateStatistics() throw (CByException);
	bool GetCapCompareFirmwareVersion() throw (CByException);
	bool GetCapConcurrentPageMode() throw (CByException);
	bool GetCapRecPageMode() throw (CByException);
	bool GetCapSlpPageMode() throw (CByException);
	bool GetCapUpdateFirmware() throw (CByException);
	
	/* Properties */
	bool GetAsyncMode() throw (CByException);
	void SetAsyncMode(bool asyncMode) throw (CByException);
	int GetCharacterSet() throw (CByException);
	void SetCharacterSet(int characterSet) throw (CByException);
	std::string GetCharacterSetList() throw (CByException);
	bool GetCoverOpen() throw (CByException);
	int GetErrorLevel() throw (CByException);
	int GetErrorStation() throw (CByException);
	std::string GetErrorString() throw (CByException);
	bool GetFlagWhenIdle() throw (CByException);
	void SetFlagWhenIdle(bool flagWhenIdle) throw (CByException);
	std::string GetFontTypefaceList() throw (CByException);
	bool GetJrnEmpty() throw (CByException);
	bool GetJrnLetterQuality() throw (CByException);
	void SetJrnLetterQuality(bool jrnLetterQuality) throw (CByException);
	int GetJrnLineChars() throw (CByException);
	void SetJrnLineChars(int jrnLineChars) throw (CByException);
	std::string GetJrnLineCharsList() throw (CByException);
	int GetJrnLineHeight() throw (CByException);
	void SetJrnLineHeight(int jrnLineHeight) throw (CByException);
	int GetJrnLineSpacing() throw (CByException);
	void SetJrnLineSpacing(int jrnLineSpacing) throw (CByException);
	int GetJrnLineWidth() throw (CByException);
	bool GetJrnNearEnd() throw (CByException);
	int GetMapMode() throw (CByException);
	void SetMapMode(int mapMode) throw (CByException);
	int GetOutputID() throw (CByException);
	std::string GetRecBarCodeRotationList() throw (CByException);
	bool GetRecEmpty() throw (CByException);
	bool GetRecLetterQuality() throw (CByException);
	void SetRecLetterQuality(bool recLetterQuality) throw (CByException);
	int GetRecLineChars() throw (CByException);
	void SetRecLineChars(int recLineChars) throw (CByException);
	std::string GetRecLineCharsList() throw (CByException);
	int GetRecLineHeight() throw (CByException);
	void SetRecLineHeight(int recLineHeight) throw (CByException);
	int GetRecLineSpacing() throw (CByException);
	void SetRecLineSpacing(int recLineSpacing) throw (CByException);
	int GetRecLinesToPaperCut() throw (CByException);
	int GetRecLineWidth() throw (CByException);
	bool GetRecNearEnd() throw (CByException);
	int GetRecSidewaysMaxChars() throw (CByException);
	int GetRecSidewaysMaxLines() throw (CByException);
	int GetRotateSpecial() throw (CByException);
	void SetRotateSpecial(int rotateSpecial) throw (CByException);
	std::string GetSlpBarCodeRotationList() throw (CByException);
	bool GetSlpEmpty() throw (CByException);
	bool GetSlpLetterQuality() throw (CByException);
	void SetSlpLetterQuality(bool recLetterQuality) throw (CByException);
	int GetSlpLineChars() throw (CByException);
	void SetSlpLineChars(int recLineChars) throw (CByException);
	std::string GetSlpLineCharsList() throw (CByException);
	int GetSlpLineHeight() throw (CByException);
	void SetSlpLineHeight(int recLineHeight) throw (CByException);
	int GetSlpLinesNearEndToEnd() throw (CByException);
	int GetSlpLineSpacing() throw (CByException);
	void SetSlpLineSpacing(int recLineSpacing) throw (CByException);
	int GetSlpLineWidth() throw (CByException);
	int GetSlpMaxLines() throw (CByException);
	bool GetSlpNearEnd() throw (CByException);
	int GetSlpSidewaysMaxChars() throw (CByException);
	int GetSlpSidewaysMaxLines() throw (CByException);
	int GetPowerNotify() throw (CByException);
	void SetPowerNotify(int powerNotify) throw (CByException);
	int GetPowerState() throw (CByException);
	int GetCartridgeNotify() throw (CByException);
	void SetCartridgeNotify(int notify) throw (CByException);
	int GetJrnCartridgeState() throw (CByException);
	int GetJrnCurrentCartridge() throw (CByException);
	void SetJrnCurrentCartridge(int cartridge) throw (CByException);
	int GetRecCartridgeState() throw (CByException);
	int GetRecCurrentCartridge() throw (CByException);
	void SetRecCurrentCartridge(int cartridge) throw (CByException);
	int GetSlpCartridgeState() throw (CByException);
	int GetSlpCurrentCartridge() throw (CByException);
	void SetSlpCurrentCartridge(int cartridge) throw (CByException);
	int GetSlpPrintSide() throw (CByException);
	bool GetMapCharacterSet() throw (CByException);
	void SetMapCharacterSet(bool mapCharacterSet) throw (CByException);
	std::string GetRecBitmapRotationList() throw (CByException);
	std::string GetSlpBitmapRotationList() throw (CByException);
	std::string GetPageModeArea() throw (CByException);
	int GetPageModeDescriptor() throw (CByException);
	int GetPageModeHorizontalPosition() throw (CByException);
	void SetPageModeHorizontalPosition(int position) throw (CByException);
	std::string GetPageModePrintArea() throw (CByException);
	void SetPageModePrintArea(std::string area) throw (CByException);
	int GetPageModePrintDirection() throw (CByException);
	void SetPageModePrintDirection(int direction) throw (CByException);
	int GetPageModeStation() throw (CByException);
	void SetPageModeStation(int Station) throw (CByException);
	int GetPageModeVerticalPosition() throw (CByException);
	void SetPageModeVerticalPosition(int position) throw (CByException);
	
	/* Methods */
	/* Methods New added */
	void Initialize() throw (CByException);
	void FontReverse(bool onoff) throw (CByException);
	void FontSelect(bool font, bool emphasize, bool doubleHeight, bool doubleWidth, bool underline) throw (CByException);
	void FontAlign(int alignment) throw (CByException);
	void NLineFeed(unsigned int repeat) throw (CByException);

	/* Methods Original */ 
	void BeginInsertion(int timeout) throw (CByException);
	void BeginRemoval(int timeout) throw (CByException);
	void ClearOutput() throw (CByException);
	void CutPaper(int percentage) throw (CByException);
	void EndInsertion() throw (CByException);
	void EndRemoval() throw (CByException);
	void PrintBarCode(int station, std::string data, int symbology, int height, int width, int alignment, int
			textPosition) throw (CByException);
	void PrintBitmap(int station, std::string fileName, int width, int alignment) throw (CByException);
	void PrintImmediate(int station, std::string data) throw (CByException);
	void PrintNormal(int station, int encoding, std::string data) throw (CByException);
	void PrintTwoNormal(int stations, std::string data1, std::string data2) throw (CByException);
	void RotatePrint(int Station, int rotation) throw (CByException);
	void SetBitmap(int bitmapNumber, int station, std::string fileName, int width, int alignment) throw (CByException);
	void SetLogo(int location, std::string data) throw (CByException);
	void TransactionPrint(int station, int control) throw (CByException);
	void ValidateData(int Station, std::string data) throw (CByException);
	void ChangePrintSide(int side) throw (CByException);
	void MarkFeed(int type) throw (CByException);
	void ClearPrintArea() throw (CByException);
	void PageModePrint(int control) throw (CByException);
	void PrintMemoryBitmap(int station, char* data, int type, int width, int alignment) throw (CByException);

	/* Statistics */
	void ResetStatistics(std::string statisticsBuffer) throw (CByException);
	void RetrieveStatistics(std::string statisticsBuffer[]) throw (CByException);
	void UpdateStatistics(std::string statisticsBuffer) throw (CByException);
	void CompareFirmwareVersion(std::string firmwareFileName, int* result) throw (CByException);
	void UpdateFirmware(std::string firmwareFileName) throw (CByException);

	/* Event Handling */
	//sigc::signal<void, int>DataEvent_signal() { return DataEvent; }
	//sigc::signal<void, int, int, int, int>ErrorEvent_signal() { return ErrorEvent; }
	//sigc::signal<void, int>OutputCompleteEvent_signal() { return OutputCompleteEvent; }
	//sigc::signal<void, int>StatusUpdateEvent_signal() { return StatusUpdateEvent; }
};

} // namespace booyopos

#endif // _BOOYO_POS_POSPRINTER_CONTROL_H_
